package com.example.recognize.controller;

import com.example.recognize.entity.RuleForm;
import com.example.recognize.entity.User;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/user")
@Slf4j
@CrossOrigin
public class UserController {
    /**
     * 用户登录
     * @param user
     */
    @PostMapping("/logon")
    public void Logon(@RequestBody User user){
        System.out.println(user.getName()+"**"+user.getPassword());
    }

    /**
     * 用户注册
     * @param ruleForm
     */
    @PostMapping("/register")
    public void register(@RequestBody RuleForm ruleForm){
        System.out.println(ruleForm.getName()+"**"+ruleForm.getPass()+"**"+ruleForm.getAge());
    }

    /**
     * 发送验证码
     * @param number
     */
    @GetMapping("/senCode")
    public void sendCode(@RequestBody String number){
        System.out.println(number);
    }

}
